#include <xp/net/inet.h>
#include <xp/bas/stdio.h>

int xp_main ()
{
	xp_uint32_t ip, mask;
	xp_char_t buf[30];
	xp_size_t len, size;

	ip = inet_addr ("123.123.2.1");
	mask = inet_addr ("255.255.255.255");

	for (size = 1; size <= xp_countof(buf); size++) {
		len = xp_inet4_ipnmtostrx (ip, mask, buf, size);
		xp_printf (XP_TEXT("[%s] len=%d, bufsize=%d\n"), buf, (int)len, (int)size);
	}
	return 0;
}
